/**
 * 首页布局
 */
"use client";
import React, { createContext, useContext  } from "react";
import Link from "next/link";

export interface SharedData {
  user: string;
  theme: string;
}

 export const SharedContext = createContext<SharedData | null>(null);

const HomeLayout = ({ children }: { children: React.ReactNode }) => {
  const sharedData = { user: 'Admin111', theme: 'dark222' }
  return (
    <div>
      <nav className="p-4 bg-gray-200">
        <Link className="text-blue-500" href="/home">
          首页
        </Link>
        <Link className="text-blue-500" href="/home/homeList">
          首页列表
        </Link>
        <Link className="text-blue-500" href="/home/homeDetails">
          首页详情
        </Link>
      </nav>
      <SharedContext.Provider value={sharedData}>
        <main>{children}</main>
      </SharedContext.Provider>
    </div>
  );
};

export default HomeLayout;
